package cn.snailhd.utils;

import java.io.File;
import java.io.FileFilter;

public class ImgFileFilter implements FileFilter {

	public boolean accept(File f) {
		if (f.isDirectory())
			return true;
		else {
			long len = (f.length()>>10);
			if(len < 20&&len>1024*20){
				return false;
			}
			
			String name = f.getName();					
			return name.endsWith(".jpeg") || name.endsWith("gif") || name.endsWith("jpg")
					|| name.endsWith(".JPEG") || name.endsWith("GIF") || name.endsWith("JPG");
		}
	}

}
